package com.mc.strategy;

/**
 * 该包内使用策略模式实现不同算法
 * @author MC
 *
 */
public class Context {
	
	private SortStrategy strategy;
	private int[] array;
	public Context(SortStrategy strategy,int[] array){
		this.strategy = strategy;
		this.array = array;
		strategy.sort(array);
	}
	public static void main(String[] args) {
		int[] array = {1,4,7,11,0,3,5,-3,0};
		Context c = new Context(new HeapStrategy(),array);
		for(int i=0;i<array.length;i++)
			System.out.println(array[i]);
	}
}
